<include file="Public:header"/>			
<div id="content">
	<div id="content-header">
		<h1>系统基本设置</h1>
	</div>
	<div id="breadcrumb">
		<a href="index.html" title="Go to Home" class="tip-bottom"><i class="fa fa-home"></i> 首页</a>
		<a href="#">系统设置</a>
		<a href="#" class="current">基本设置</a>
	</div>
	<div class="container-fluid">
		<div class="row">
			<div class="col-xs-12">
				<div class="widget-box">
					<div class="widget-title">
						<span class="icon">
							<i class="fa fa-flask"></i>									
						</span>
						<h5>系统基本设置</h5>
					</div>
					<div class="widget-content nopadding">
						<form method="get" class="form-horizontal">
							
							<div class="form-group">
                            <label class="col-sm-3 col-md-3 col-lg-1 control-label">网站标题</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="{$info.title}" class="form-control input-sm" id="title" />
                                    </div>
                                </div>
                            </div>
                            
                            <div class="form-group">
                            <label class="col-sm-3 col-md-3 col-lg-1 control-label">次级标题</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="{$info.title2}" class="form-control input-sm" id="title2" />
                                    </div>
                                </div>
                            </div>
                            
                            <div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">关键词</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-tag"></i></span>
                                    	<input type="text" value="{$info.keyword}" class="form-control input-sm"  placeholder="用,分开" id="keyword"/>
                                    </div>
                                </div>
                            </div>
							
							<div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">注册时间</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-calendar"></i></span>
                                    	<input type="text" value="{$info.createtime}" class="form-control input-sm" id="createtime" />
                                    </div>
                                </div>
                            </div>
                            
                            <div class="form-group">
								<label class="col-sm-3 col-md-3 col-lg-1 control-label">站点描述</label>
								<div class="col-sm-9 col-md-9 col-lg-10">
									<textarea rows="5" class="form-control" id="remark">{$info.remark}</textarea>
								</div>
							</div>
							
                             <div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">站长名称</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="{$info.author}" class="form-control input-sm" id="author" />
                                    </div>
                                </div>
                            </div>
                            
                             <div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">备案号</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="{$info.icp}" class="form-control input-sm" id="icp" />
                                    </div>
                                </div>
                            </div>
							
							<div class="form-group">
                                <label class="col-sm-3 col-md-3 col-lg-1 control-label">版权代码</label>
                                <div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="{$info.copy}" class="form-control input-sm" id="copy" />
                                    </div>
                                </div>
                            </div>
                            
                            <div class="form-group">
								<label class="col-sm-3 col-md-3 col-lg-1 control-label">统计代码</label>
								<div class="col-sm-9 col-md-9 col-lg-10">
									<textarea rows="5" class="form-control" id="foot">{$info.footer}</textarea>
								</div>
							</div>
							
							<div class="form-group">
								<label class="col-sm-3 col-md-3 col-lg-1 control-label">访问总量</label>
								<div class=" col-sm-9 col-md-9 col-lg-10">
                                	<div class="input-group input-group-sm">
										<span class="input-group-addon"><i class="fa fa-user"></i></span>
                                    	<input type="text" value="{$info.hit} " class="form-control input-sm" id="hit" />
                                    	<input type="hidden" value="__SELF__" id="jump"/>
                                    </div>
                                </div>
							</div>
                            
							<div class="form-actions">
								<button type="button" class="btn btn-success btn-sm addsystem">存入数据库</button>  <button type="button" class="btn btn-danger btn-sm">取消</button>
							</div>
						</form>
					</div>
				</div>						
			</div>
		</div>
	</div>
</div>
<include file="Public:footer"/>
<script>
$(document).ready(function(){
	$('.addsystem').click(function(){
		var jump = $("#jump").val();
    	var title = $("#title").val();
    	var title2 = $("#title2").val();
    	var keyword = $("#keyword").val();
    	var author = $("#author").val();
    	var remark = $("#remark").val();
		var createtime = $("#createtime").val();
		var icp = $("#icp").val();
		var copy = $("#copy").val();
		var footer = $("#foot").val();		
		var hit = $('#hit').val();
		if(!title){
			err("网站名称不能为空!");
			return false;
		}else if(!title2){
			err("请设置二级标题!");
			return false;
		}else if(!author){
			err("请设置站长!");
			return false;
		}else if(!createtime){
			err("请填写创建时间!");
			return false;
		}else if(!copy){
			err("请填写版权!");
			return false;
		}else if(!hit){
			err("点击量不能为空!");
			return false;
		}
		$(".addsystem").attr("disabled",true);
		$.ajax({
			type:"post",
			url:"/Admin/System/basic",
			async:true,
			data:{"title":title,"title2":title2,"remark":remark,"keyword":keyword,"author":author,"createtime":createtime,"icp":icp,"copy":copy,"footer":footer,"hit":hit},
			success:function(data){
				if(data.error==0){
					succ("系统基本设置完成!",data.msg,jump);
				}else{
					err(data.msg);
					$(".addsystem").removeAttr('disabled');
				}
			},
			eerror:function(data){
				err("网络错误!");
				$(".addsystem").removeAttr('disabled');
			}
		});
	});
});
</script>
</body>
</html>
